<?php include dirname(__FILE__).'/common/header.php'; ?>

<?php include dirname(__FILE__).'/common/menu.php'; ?>

var attr = {};
attr.ctrlName = '<?php echo $ctrlName; ?>';

/*
| -------------------------------------------------------------------
|  List Grid
| -------------------------------------------------------------------
*/
list.grid = new ZM.GridPanel({
    url: list.baseUrl + attr.ctrlName+'/getAnswerList',
    tbar:[{
        text:'导出过滤顾客',
        cls:'btn-show',
        hidden:!Ext.permission[attr.ctrlName + '/exportAnswerList'.toLowerCase()],
        handler:function() {
            var sortInfo = list.grid.store.getSortState();
            if(sortInfo) {
                list.grid.store.baseParams['sort'] = sortInfo['field'];
                list.grid.store.baseParams['dir'] = sortInfo['direction'];
            }
            location.href = list.baseUrl + attr.ctrlName + '/exportAnswerList?'+ Ext.urlEncode(list.grid.store.baseParams);
        }
    }],
    columns:[
        {header:'ID',dataIndex:'answer_id'},
        {header:'结果',dataIndex:'answer_result',width:180,filter:{}},
        {header:'问题1',dataIndex:'answer0',width:60,filter:{}},
        {header:'问题2',dataIndex:'answer1',width:60,filter:{}},
        {header:'问题3',dataIndex:'answer2',width:60,filter:{}},
        {header:'问题4',dataIndex:'answer3',width:60,filter:{}},
        {header:'问题5',dataIndex:'answer4',width:60,filter:{}},
        {header:'问题6',dataIndex:'answer5',width:60,filter:{}},
        {header:'问题7',dataIndex:'answer6',width:60,filter:{}},
        {header:'问题8',dataIndex:'answer7',width:60,filter:{}},
        {header:'问题9',dataIndex:'answer8',width:60,filter:{}},
        {header:'问题10',dataIndex:'answer9',width:60,filter:{}},
        {header:'创建时间',dataIndex:'answer_time_create',width:140,filter:{xtype:'daterangefield'}}
    ]
});

<?php include dirname(__FILE__).'/common/layout.php'; ?>
list.grid.store.load();
<?php include dirname(__FILE__).'/common/footer.php'; ?>
